//
//  BudgetCombine.swift
//  KoiAccounting
//
//  Created by 纪洪文 on 16.04.25.
//

import Foundation
struct BudgetCombine : Identifiable {
    var id : Int {
        return budget.id ?? 0
    }
    var budget: AccountingBudget
    var category: AccountingCategory
    var expenseAmount: Double
    
    func getBudgetAmount() -> Double {
        return budget.amount ?? 0
    }
    
    func getSurplus() -> Double {
        return getBudgetAmount() - expenseAmount
    }
    
    func getUsePercent() -> Double {
        return expenseAmount / getBudgetAmount()
    }
}
